package com.tank.entrity;

import java.awt.*;

/**
 * 墙
 */
public class Wall extends GameObject {
    private final int width, height;

    public Rectangle getWallRectangle() {
        return wallRectangle;
    }

    private final Rectangle wallRectangle;

    public Wall(int x, int y, int width, int height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.wallRectangle = new Rectangle(x, y, width, height);
    }

    @Override
    public void paint(Graphics graphics) {
        Color color = graphics.getColor();
        graphics.setColor(Color.pink);
        graphics.fillRect((int)x, (int)y, width, height);
        graphics.setColor(color);
    }

    @Override
    public int getWidth() {
        return width;
    }

    @Override
    public int getHeight() {
        return height;
    }
}
